package com.tz.yiqingapp.controller.doctor;



import com.tz.yiqingapp.bean.Admin;
import com.tz.yiqingapp.bean.Hosptial;
import com.tz.yiqingapp.config.AccessLimit;
import com.tz.yiqingapp.dto.PageDTO;
import com.tz.yiqingapp.mapper.AdminMapper;
import com.tz.yiqingapp.mapper.DoctorMapper;
import com.tz.yiqingapp.mapper.HosptialMapper;
import com.tz.yiqingapp.utils.MyPasswordEncoder;
import com.tz.yiqingapp.utils.ResponseUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/doctor")
public class DoctorHosptial {

    @Autowired
    AdminMapper adminMapper;

    @Autowired
    HosptialMapper hosptialMapper;

    @Autowired
    DoctorMapper doctorMapper;


    @AccessLimit(times = 5)
    @PostMapping("/getHosptialAll")
    @ResponseBody
    public HashMap<String, Object> getHosptialAll(@RequestBody PageDTO pageDTO, HttpServletRequest request) {

        List<Hosptial> hosptials = hosptialMapper.selectList(null);
        return ResponseUtils.success(hosptials);
    }
}
